exports.GLTextAlert = GL2.Node.subclass(
{
    classname: 'GLTextAlert',
    
    initialize: function(text) 
    {
 //   	this.setFrame([TCUtil.getAdjustedX(0),TCUtil.getAdjustedY(0),TCUtil.getAdjustedX(320),TCUtil.getAdjustedY(480)]);
 		//this.setGradient({ corners: '0 0 0 0', outerLine: "00000000 0", gradient: [ "F0000000 0.0", "F0000000 0.1" ] });
		this._backgroundImage = null;
		var text = null;
//		if(!text)
//		{
//			text = "";
//		}
		this._text = text
    },
	
	createView: function() 
	{
		var backgroundPath = this.getBaseResourcePath() + "bubble.png";

		this._backgroundImage = GLFactory.getSprite([TCUtil.getAdjustedX(0),TCUtil.getAdjustedY(0)],100000,backgroundPath,[TCUtil.getAdjustedX(200),TCUtil.getAdjustedY(200)], [0,0]);
		this.addChild(this._backgroundImage);
		
		this._textArea = GLFactory.getText([TCUtil.getAdjustedX(10) , TCUtil.getAdjustedY(0)],100000,this._text,[TCUtil.getAdjustedX(180), TCUtil.getAdjustedY(170)], TCUtil.getAdjustedFontSize(90), GL2.Text.HorizontalAlign.Center, null, GL2.Text.OverflowMode.Multiline, [0,0],  new Core.Color(0,0,0));
		this._backgroundImage.addChild(this._textArea);
	},
	
	show: function()
	{
		GL2.Root.addChild(this);
	},
	
	setCurrentPosition: function(position)
	{
		if(position)
		{
			this.setPosition(position);
		}
	},
	
	getBaseResourcePath: function()
	{
		return "./Content/images/gamelayer/controllayer/tutorial/";
	},
	
	updateText: function(text)
	{
		if(text)
		{
			this._textArea.setText(text);
		}
	},
	
	destroy: function ()
	{
		if(this._backgroundImage)
		{
			this._backgroundImage.destroy();
			this._backgroundImage = null;
		}
		if(this._textArea)
		{
			this._textArea.destroy();
			this._textArea = null;
		}
	}
});